package com.miplus.ccrm.uploadjob.service.imaging;

import com.miplus.ccrm.uploadjob.service.imaging.req.ImagingResVo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author： Yaohui
 * @Date： 2025/2/27 15:58
 * @Describe：
 */
@Service
public class ImagingPlatformService {

    @Value("${hrbank.image.pla.sysId}")
    private String sysId;

    @Value("${hrbank.image.pla.sysKey}")
    private String sysKey;

    @Value("${hrbank.image.pla.uipIp}")
    private String uipIp;

    @Value("${hrbank.image.pla.uipPort}")
    private String uipPort;
    @Value("${hrbank.image.pla.channel}")
    private String channel;
    @Value("${hrbank.image.pla.billType}")
    private String billType;

    @Value("${hrbank.image.pla.httpfiletransIp}")
    private String httpfiletransIp;

    @Value("${hrbank.image.pla.httpfiletransPort}")
    private String httpfiletransPort;



    /**
     * 影像平台上传
     */
    public ImagingResVo UploadFile(String fileName, String imgPath){


        /**
         * 疑问
         * isPutIn 是否入库
         */

        Map<String,Object> saveMap = new HashMap<String,Object>();
        saveMap.put("tranCode", "2008");//交易码
        /**
         * 4位系统来源+16位渠道码/商户号+YYYYMMDD+8流水号
         * 例如：NCMSqk000000000000012019061000000001
         * busiNo+sysId须唯一
         */
        saveMap.put("busiNum", "cfs-0107300000103301120160002019");//请求流水号
        saveMap.put("sysId",sysId);//系统来源
        saveMap.put("sysKey",sysKey);//系统密钥
        saveMap.put("operaCode", "000001");
        saveMap.put("operaName", "NDCSSYS");
        saveMap.put("fileName", fileName);
        saveMap.put("fileType", "2");//文件类型 1:影像 2:文件
        saveMap.put("imgPath", imgPath);//本地影像路径
        saveMap.put("billType", billType);//影像类型 业务人员申请的影像编码
        saveMap.put("isPutIn", "1");
        saveMap.put("uipIp",uipIp);// 访问系统IP
        saveMap.put("uipPort", uipPort);//访问系统端口
        saveMap.put("httpfiletransIp", httpfiletransIp);//影像上传IP
        saveMap.put("httpfiletransPort",httpfiletransPort);//影像上传端口
        saveMap.put("channel", channel);//渠道码
//        saveMap.put("remark", "身份证");
//        saveMap.put("idType", "1");
//        saveMap.put("idNo", "2789");
//        saveMap.put("cusNo", "12456");
//        saveMap.put("accNo", "456789");
//        saveMap.put("branchNo", "1234");
//        saveMap.put("billTypeSec", "");
//        saveMap.put("responseCode", "111");//响应码
//        saveMap.put("thirdNo", "123");
//        ImageUpload2008Return tran2008Return = ImageUpload2008Service.TransferToReturn(saveMap);


        return new ImagingResVo();

    }

}
